<template>
	<view class="noticeLayout">
		<view class="title">
			<view class="tag" v-if="detail.article_status">
				<uni-tag :inverted="true" text="置顶" type="error"></uni-tag>
			</view>
			<view class="font">{{detail.title}}</view>
		</view>
		<view class="info">
			<view class="item">{{detail.author}}</view>
			<view class="item">
				<uni-dateformat :date="detail.publish_date" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat>
			</view>
		</view>
		
		<view class="content">
			<rich-text :nodes="detail.content"></rich-text>
		</view>
		
		<view class="count">阅读{{detail.view_count}}</view>
		
	</view>
</template>

<script setup>
import { ref } from "vue";
import {apiWallNewsDetail} from "@/api/apis.js"
const detail = ref({})

let noticeId;
onLoad((e)=>{
	noticeId = e.id;
	getNewsDetail()
})

function getNewsDetail(){
	apiWallNewsDetail({id:noticeId}).then((res)=>{
		console.log(res);
		detail.value = res.data
	})
	
}
</script>

<style lang="scss" scoped>
.noticeLayout{
	padding: 30rpx;
	.title{
		display: flex;
		align-items: center;
		font-size: 40rpx;
		padding-bottom: 30rpx;
		line-height: 1.6em;
		.tag{
			transform: scale(0.8);
			transform-origin: left center;
			flex-shrink: 0;
		}
	}
	.info{
		display: flex;
		align-items: center;
		font-size: 28rpx;
		color: #999;
		.item{
			padding-right: 20rpx;
		}
	}
	.content{
		padding: 50rpx 0;
	}
	.count{
		color: #999;
		font-size: 28rpx;
	}
}

</style>
